Return error in case of runner crash#69
Merged
Merged
Conversation
xenoscopic
reviewed
Jun 6, 2025
| proxyLog: proxyLog, | ||
| } | ||
|
|
||
| proxy.ErrorHandler = func(w http.ResponseWriter, req *http.Request, err error) { |
Contributor
There was a problem hiding this comment.
Since this is going to be sent back to OpenAI clients, I would try to structure the error responses in a format they can parse. Documentation is a little sparse, but Google says the error format looks like:
{
"error": {
"message": "Invalid 'messages[1].content': string too long. Expected a string with maximum length 1048576, but got a string with length 1540820 instead.",
"type": "invalid_request_error",
"param": "messages[1].content",
"code": "string_above_max_length"
}
}
The only docs I can find for the API are https://platform.openai.com/docs/api-reference/responses-streaming/error
In case the runner crashes it would be nice to return an error to the user. So, add an error handler on the proxy and use it to try to figure out if the runner crashed and format the response error accordingly. Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
fe4ca85 to
aaacee4
Compare
doringeman
reviewed
Jun 17, 2025
doringeman
left a comment
Contributor
There was a problem hiding this comment.
How can I easily test this to see the error?
Signed-off-by: Piotr Stankiewicz <piotr.stankiewicz@docker.com>
doringeman
approved these changes
Jun 17, 2025
Co-authored-by: Dorin-Andrei Geman <dorin.geman@docker.com>
xenoscopic
approved these changes
Jun 17, 2025
doringeman
pushed a commit
to doringeman/model-runner
that referenced
this pull request
Sep 23, 2025
* Adds Total and Pulled fields to ProgressMessage struct to track the total bytes to transfer and bytes transferred so far * Use uint64 type to represent pulled and total
doringeman
pushed a commit
to doringeman/model-runner
that referenced
this pull request
Sep 24, 2025
* Adds Total and Pulled fields to ProgressMessage struct to track the total bytes to transfer and bytes transferred so far * Use uint64 type to represent pulled and total
doringeman
pushed a commit
to doringeman/model-runner
that referenced
this pull request
Oct 2, 2025
docs: update dmr cmds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In case the runner crashes it would be nice to return an error to the
user. So, add an error handler on the proxy and use it to try to figure
out if the runner crashed and format the response error accordingly.
Based on: #68